# -*- coding: utf-8 -*-

from django.db import models

  
class Message(models.Model):
    '''留言信息
    
    '''
    content = models.CharField("留言", max_length=100)
    display = models.BooleanField("显示", default=True)
    username = models.CharField("用户名", max_length=20, null=True, blank=True)
    name = models.CharField("姓名", max_length=20, null=True, blank=True)
    email = models.CharField("邮箱", max_length=100, null=True, blank=True)
    category = models.CharField("类型", max_length=20, null=True, blank=True)
    response = models.TextField("回应", max_length=500, null=True, blank=True, help_text="限500个字符")
    date = models.DateTimeField("发布日期", auto_now_add=True)

    class Meta:
        verbose_name = "留言信息"
        verbose_name_plural = verbose_name
        ordering = ['username', 'category', 'date']

    def __str__(self):
        return self.content
    

    
    
    

 

    
    